package launch.helpers;

import java.io.File;
import java.util.ArrayList;
import java.util.List;
import provider.PureData;
import provider.PureDataProviderFactory;
import provider.PureDataTool;


public class PureLoginHelper {

    private final static PureLoginHelper instance = new PureLoginHelper();
    protected final List<String> ForbiddenName = new ArrayList<String>();

    public static PureLoginHelper getInstance() {
	return instance;
    }

    protected PureLoginHelper() {
	final PureData nameData = PureDataProviderFactory.getDataProvider(new File("wz/Etc.wz")).getData("ForbiddenName.img");
	for (final PureData data : nameData.getChildren()) {
	    ForbiddenName.add(PureDataTool.getString(data));
	}
    }

    public final boolean isForbiddenName(final String in) {
	for (final String name : ForbiddenName) {
	    if (in.contains(name)) {
		return true;
	    }
	}
	return false;
    }
}